package ie.dcu.spca.data;

import ie.dcu.spca.model.Bean;
import ie.dcu.spca.model.bean.Product;

import java.util.List;
import java.util.Map;

public interface ProductDataManager extends BasicDataManager {

    static final int DEFAULT_PRODUCT_ID = -1;

    /**
     * @return All product From DB
     */
    List<Product> get();

    int create(String name, String barcode, double price, int categoryId,
            int unitId);

    int existOrCreate(int id, String name, String barcode, double price,
            int categoryId, int unitId);

    void update(int id, String name, String barcode, double price,
            int categoryId, int unitId);

    public List<Map<String, Object>> getIdNameBarcodePriceMapList();

    public List<Map<String, Object>> getIdNameBarcodePriceMapList(
            List<Bean> beanList);

    Product get(int id);

    Product get(int id, String barcode);

    int getDefaultProductId();

    void loadDefault(PriceUnitDataManager unitM, CategoryDataManager categoryM);

    String getPriceAndUnit(Product product);
}
